package com.ruoyi.system.telMsg.service.impl;

import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.system.telMsg.domain.TelSendMsg;
import com.ruoyi.system.telMsg.mapper.TelSendMsgMapper;
import com.ruoyi.system.telMsg.service.ITelSendMsgService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 短信发送记录Service业务层处理
 *
 * @author ruoyi
 * @date 2025-03-15
 */
@Service
public class TelSendMsgServiceImpl implements ITelSendMsgService {
    @Autowired
    private TelSendMsgMapper telSendMsgMapper;

    /**
     * 查询短信发送记录
     *
     * @param id 短信发送记录主键
     * @return 短信发送记录
     */
    @Override
    public TelSendMsg selectTelSendMsgById(Long id) {
        return telSendMsgMapper.selectTelSendMsgById(id);
    }

    /**
     * 查询短信发送记录列表
     *
     * @param telSendMsg 短信发送记录
     * @return 短信发送记录
     */
    @Override
    public List<TelSendMsg> selectTelSendMsgList(TelSendMsg telSendMsg) {
        return telSendMsgMapper.selectTelSendMsgList(telSendMsg);
    }

    /**
     * 新增短信发送记录
     *
     * @param telSendMsg 短信发送记录
     * @return 结果
     */
    @Override
    public int insertTelSendMsg(TelSendMsg telSendMsg) {
        telSendMsg.setCreateTime(DateUtils.getNowDate());
        return telSendMsgMapper.insertTelSendMsg(telSendMsg);
    }

    /**
     * 修改短信发送记录
     *
     * @param telSendMsg 短信发送记录
     * @return 结果
     */
    @Override
    public int updateTelSendMsg(TelSendMsg telSendMsg) {
        return telSendMsgMapper.updateTelSendMsg(telSendMsg);
    }

    /**
     * 批量删除短信发送记录
     *
     * @param ids 需要删除的短信发送记录主键
     * @return 结果
     */
    @Override
    public int deleteTelSendMsgByIds(Long[] ids) {
        return telSendMsgMapper.deleteTelSendMsgByIds(ids);
    }

    /**
     * 删除短信发送记录信息
     *
     * @param id 短信发送记录主键
     * @return 结果
     */
    @Override
    public int deleteTelSendMsgById(Long id) {
        return telSendMsgMapper.deleteTelSendMsgById(id);
    }
}
